/*
 *
 * This file is part of the open-source SeetaFace engine, which includes three modules:
 * SeetaFace Detection, SeetaFace Alignment, and SeetaFace Identification.
 *
 * This file is part of the SeetaFace Detection module, containing codes implementing the
 * face detection method described in the following paper:
 *
 *
 *   Funnel-structured cascade for multi-view face detection with alignment awareness,
 *   Shuzhe Wu, Meina Kan, Zhenliang He, Shiguang Shan, Xilin Chen.
 *   In Neurocomputing (under review)
 *
 *
 * Copyright (C) 2016, Visual Information Processing and Learning (VIPL) group,
 * Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China.
 *
 * The codes are mainly developed by Shuzhe Wu (a Ph.D supervised by Prof. Shiguang Shan)
 *
 * As an open-source face recognition engine: you can redistribute SeetaFace source codes
 * and/or modify it under the terms of the BSD 2-Clause License.
 *
 * You should have received a copy of the BSD 2-Clause License along with the software.
 * If not, see < https://opensource.org/licenses/BSD-2-Clause>.
 *
 * Contact Info: you can send an email to SeetaFace@vipl.ict.ac.cn for any problems.
 *
 * Note: the above information must be kept whenever or wherever the codes are used.
 *
 */

#ifndef SEETA_FD_CLASSIFIER_SURF_MLP_H_
#define SEETA_FD_CLASSIFIER_SURF_MLP_H_

//#include <memory>

#include "classifier.h"
#include "mlp.h"
#include "surf_feature_map.h"

//namespace seeta {
//namespace fd {
typedef struct classSURFMLP SURFMLP;
struct classSURFMLP{
  int32_t* feat_id_;
  float* input_buf_;
  float* output_buf_;
  MLPLayer mlpplayer;
  MLP  mlp;
  float thresh_;
  SURFFeatureMap feat_map_;
  Classifier classifier;
};
void InitSURFMLP(struct classSURFMLP *p);
void ReleaseSURFMLP(struct classSURFMLP *p);
//bool SURFMLPClassify(struct classSURFMLP *p, SURFFeatureMap* feat_map, FDHandle* handle,float* score = nullptr , float* outputs = nullptr);
bool SURFMLPClassify(struct classSURFMLP *p, SURFFeatureMap* feat_map, FDHandle* handle, float* score , float* outputs );

void SURFMLPAddFeatureByID(struct classSURFMLP *p, int32_t feat_id,int n);
//void SURFMLPAddLayer(struct classSURFMLP *p, int32_t input_dim, int32_t output_dim, const float* weights,const float* bias,int list, bool is_output = false);
void SURFMLPAddLayer(struct classSURFMLP *p, int32_t input_dim, int32_t output_dim, const float* weights,const float* bias, int list, bool is_output );


void SURFMLPSetFeatureMap(struct classSURFMLP *p, SURFFeatureMap* feat_map);

int SURFMLPtype(struct classSURFMLP *p);
void SURFMLPSetThreshold(struct classSURFMLP *p, float thresh) ;


#endif  // SEETA_FD_CLASSIFIER_SURF_MLP_H_
